<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="com.cg.slms.domain.*,java.util.*"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%
	if (request.getAttribute("stockin") == null) {
		Stockin stockin = new Stockin();
		stockin.setMerchandise(new Merchandise());
		stockin.setClient(new Client());
		stockin.setEmployee(new Employee());
		request.setAttribute("stockin", stockin);
	}
%>
<html>
<head>
<base href="<%=basePath%>" />
<meta charset="UTF-8">
<title>修改进货单</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">

<script language="javascript" src="script/main.js"></script>
<script language="javascript" src="script/calendar5.js"></script>
<script type="text/javascript">
    var c = new Calendar("c");                     
    document.write(c);
    function getsum(){
    	var amount;var price;amount = stockin.amount.value;price = stockin.price.value;stockin.money.value = amount * price;
    }

</script>  
</head>
<body>
<p><font style="font-size:20px;position:relative;left:450px;top:50px">进货管理→进货单→修改进货单</font></p>
<form:form action="updateStockinAction" method="post" name="stockin" modelAttribute="stockin">
<br><br><br>
	<table border="0" cellpadding="1" cellspacing="1" width="95%">
		<tr>
		    <td align="right" width="10%" nowrap="nowrap">ID:</td>
			<td width="20%">
				<form:input path="id" class="form-control" readonly="true"></form:input>
			</td>
			<td align="right" width="10%" nowrap="nowrap">进货单编号</td>
			<td width="20%">
				<form:input path="code" class="form-control" ></form:input>
				<form:errors path="code" style="color:red"></form:errors>
			</td>
			<td align="right" width="10%" nowrap="nowrap">货物名称</td>
			<td width="20%">
				<form:select path="merchandise.id" items="${merchandises}" />
			</td>
			<td align="right" width="10%">供应商</td>
			<td width="20%">
				<form:select path="client.id" items="${clients}"/>
			</td>
			<td width="10%">&nbsp;</td>
		</tr>
		<tr>
			<td align="right" width="10%" nowrap="nowrap" style="position:relative;top:30px">进货数量</td>
			<td width="20%">
				<form:input path="amount" name="amount" class="form-control" style="position:relative;top:30px" ></form:input>
			</td>
			<td align="right" width="10%" nowrap="nowrap" style="position:relative;top:30px">进货单价</td>
			<td width="20%">
				<form:input path="price" name="price" class="form-control" style="position:relative;top:30px" />
			</td>
			<td align="right" width="10%" style="position:relative;top:30px">进货总价</td>
			<td width="20%">
				<form:input path="money" name="money" class="form-control" onclick="getsum()" style="position:relative;top:30px"/>
			</td>
			<td width="10%">&nbsp;</td>
		</tr>
		<tr>
			<td align="right" width="10%" nowrap="nowrap" style="position:relative;top:60px">进货日期</td>
			<td width="20%">
				<form:input path="stockindate" class="form-control"  onclick="c.show(this);" style="position:relative;top:60px"/>
			</td>
			<td align="right" nowrap="nowrap" style="position:relative;top:60px">经手人</td>
			<td>
				<form:select path="employee.id" items="${employees}" style="position:relative;top:60px"/>
			</td>
			<td align="right">&nbsp;</td>
			<td>&nbsp;</td>
			<td>&nbsp;</td>
		</tr>
	</table>

	<p></p>
	<div style="margin-left: 30px; margin-right: 0px">
	<table border="0" cellpadding="0" cellspacing="0" width="95%" style="position:relative;top:100px;left:450px">
		<tr>
			<td width="10%">
				<input type="submit" value="修改" class="btn btn-info" />
			</td>
			<td width="10%">
				<a href="preStockinAction" class="btn btn-info">返回</a>
			</td>
			<td width="80%">&nbsp;</td>
		</tr>
	</table>
	</div>
</form:form>
</body>
</html>